#ifndef _IMAGE_PROC_H_
#define _IMAGE_PROC_H_
#include "kcftracker.h"
#include "asyncBase.h"
#include "commonDefine.h"
#include "fdsst_track.h"
#include "my_algor_base.h"


class ImgProcManager{
public:
    ImgProcManager(std::shared_ptr<notifyCond<image_detect_info>>& nc);
    ~ImgProcManager(); 

    int procSysInit();
    void switchTrackMode(DetectRect& rect); 
    void switchDetectMode();
    void switchIdleMode(){workMode = -1;}

    int currentAlgorMode(){return workMode;}

    int ImgAlgorProcRun();
    int ImgAlgorProcStop();
private:
    int thrImgAlgorProc();

private:
    // kcfTracker is sample call
    std::atomic_int                      workMode;
    std::atomic_bool                     initFlag;
    DetectRect                           initRect;

    std::unique_ptr<KCFTracker>          kcf;
    FdsstAlgor                           fdsst;
    SkyDetectAlgor                       detect;

    std::unique_ptr<ThreadHelper> thrHandler;
    std::shared_ptr<notifyCond<image_detect_info>> cond;
};
#endif